home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c-part1 / 6325 < prev    next >
Encoding:
Internet Message Format  |  1996-08-05  |  1.3 KB

  1. Path: news.luc.edu!user
  2. From: VArase@varase.it.luc.edu (Verne Arase)
  3. Newsgroups: comp.lang.pl1,comp.lang.c
  4. Subject: Re: PL/I and C
  5. Date: Fri, 23 Feb 1996 17:34:11 -0600
  6. Organization: LUMC
  7. Message-ID: <AD53AB1396681879FA@mcdialb10.it.luc.edu>
  8. References: <4gh5ru$eng@goanna.cs.rmit.EDU.AU> <312CCEB2.4AB7@corp.dialog.com> <AD536AAB9668B76CD@mcdialb09.it.luc.edu> <312E363C.3CDE@corp.dialog.com>
  9. NNTP-Posting-Host: 147.126.240.126
  10.  
  11. In article <312E363C.3CDE@corp.dialog.com>,
  12. Paul Gorodyansky <paul_gorodyansky@corp.dialog.com> wrote:
  13.  
  14.  >Sorry, you missed my point. If I want to have SEVERAL masks for THE SAME
  15.  >area of memory, that is have SEVERAL DIFFERENT Structures overlaid my
  16.  >buffer, C has a feature for this - a Union, where I can have members of
  17.  >different Nature overlaid the same area of memory, BUT, unlike PL/I, an
  18.  >Array CAN NOT be a member of a Union. But, it is always a case in our
  19.  >Text Processing - I want to look at my source record's buffer at some 
  20.  
  21. Huh? Why not? I know of no rule which would preclude having an array in a
  22. union.
  23.  
  24. ... and BTW, you don't need to use a union; you can simply have several
  25. pointers, each containing the same address. Just coerce them with a cast.
  26.  
  27.    foo *x;
  28.    bar *y;
  29.  
  30.    y=(bar *) x;
  31.  
  32. ---
  33. The above are my own opinions, and not those of my employer.
  34.